import React from 'react';
import Navheader from '@/components/Navheader';
import { useDispatch } from 'react-redux';
import { update } from '@/store/index';
import { useNavigate } from 'react-router-dom'
type Props = {}

export default function Mine({ }: Props) {

    const dispatch = useDispatch()
    const navigate = useNavigate()
    // 定义注销登录事件
    const loginout = () => {
        // 清除本地的存的内容
        localStorage.removeItem('token');
        dispatch(update(null))
        navigate('/login')
    }
    return (
        <div>
            <Navheader title='个人中心' isshow={true} righttitle={'退出'} callback={loginout}></Navheader>
        </div>
    )
}